<template>
  <div class="integral">
    <div class="title flex flex-between">
      <p class="left">积分购</p>
      <div class="right flex">
        <p class="text1">当前积分:</p>
        <p class="textNum">{{ integration }}</p>
        <p class="text2">积分加速</p>
      </div>
    </div>
    <div class="allItem flex">
      <div v-for="(item,index) in integralList" :key="index">
        <div class="item">
          <div class="floatLeft">
            <p class="mark"
               :class="{mark1:item.type==='代金券',
          mark2:item.type==='兑换券',
          mark3:item.type==='折扣券'}">{{ item.type }}</p>
            <img :src=item.img>
          </div>
          <div class="floatRight">
            <p class="title">{{ item.title }}</p>
            <div class="flex flex-around num">
              <p class="money">{{ item.money }}</p>
              <p class="jf">{{ item.integration }}</p>
            </div>
          </div>
        </div>
      </div>
      <div class="more textAlignCenter">
        <p>更多+</p>
      </div>
    </div>
  </div>
</template>

<script>
import "./style/home.less"

export default {
  name: "integral",
  props: {
    integralList: { //积分购数据
      type: Array,
      default() {
        return [{id: "001", title: "Title", type: "type", img: require("@/assets/logo.png"), money: 0, integration: 0},
          {id: "002", title: "Title", type: "type", img: require("@/assets/logo.png"), money: 0, integration: 0}]
      }
    },
    integration: {  //当前积分
      type: Number,
      default: 0
    }
  }
}
</script>

<style scoped>
.more {
  width: 2rem;
  height: 1.92rem;
  line-height: 1.92rem;
  flex-shrink: 0;
  margin-right: .27rem;
  background: #F8F8F8;
  border-radius: 0.16rem;
  font-size: .5rem;
  color: #6a6969;
}
</style>